package com.tanhua.service;


import com.tanhua.model.mongo.Friend;
import com.tanhua.model.mongo.Movement;
import com.tanhua.model.mongo.MovementTimeLine;
import com.tanhua.model.vo.PageResult;
import org.bson.types.ObjectId;

import java.util.List;

public interface MovementApi {

    /**
     * 保存动态
     * @param movement
     */
    String publish(Movement movement);

    /**
     * 分页查询用户动态
     * @param page
     * @param pagesize
     * @param userId
     * @return
     */
    PageResult pageMovements(Integer page, Integer pagesize, Long userId);

    /**
     * 查询用户好友
     * @param id
     * @return
     */
    PageResult getFriend(Long id);

//    PageResult getFriendMovements(Long id, Integer page, Integer pagesize);


    List<Movement> getMovements(List<ObjectId> movementIds, Integer page, Integer pagesize);

    //查询用户可以看的动态id
    List<MovementTimeLine> getVisible(Long id);
    //获取集合中的动态
    List<Movement> selectMovement(List<Long> collect);
    //随机推送pagesize条的动态
    List<Movement> randomMovement(Integer counts);

    Movement getById(ObjectId objectId);

    PageResult getMovementsState(Integer page, Integer pagesize, Long userId, String state);

    void updateMovementState(Movement movement, int state);
}